package com.augurit.gzcgwsp.csshlj.dao;

import java.util.List;

import org.hibernate.Session;
import org.springframework.stereotype.Repository;

import com.augurit.gzcgwsp.csshlj.entity.Csshljcz;
import com.augurit.gzcgwsp.smartformCsdlwj.dao.SmartformBaseDao;


/**
 * 城市生活垃圾处置
 * @author ZHANGJUN
 *
 */
@Repository
public class CsshljCzDao extends SmartformBaseDao<Csshljcz,Long>{
	public List getListById(String sql){
        List list= super.queryForList(sql);
        return list;
    }
	
	
	/**
	 * 保存时候返回主键
	 * @param obj
	 * @return
	 */
	public Long saveObj(Csshljcz obj){
		Session session=this.getSession();
		return (Long) session.save(obj);
	}


	public Csshljcz getEntity(Long id) {
		String sql=" from Csshljcz where id="+id;
		List<Csshljcz> list=super.find(sql);
		if(list.size()>0)
			return list.get(0);
		return null;
	}
}
